import Vue from 'vue'
import App from './App'
import store from './store/index.js'

Vue.config.productionTip = false

App.mpType = 'app'

import setting from 'setting.js';
Vue.use(setting);

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);

// 一些时间方法
import dateMeans from '@/common/dateMeans.js';
Vue.use(dateMeans);

// 一些全局过滤方法
import overallFilter from '@/common/overallFilter.js';
Vue.use(overallFilter);

// 国际化
import VueI18n from 'vue-i18n';
Vue.use(VueI18n)
import messages from './locale/index';
let i18nConfig = {
	locale: uni.getLocale(),
	messages,
}
const i18n = new VueI18n(i18nConfig)

Vue.config.ignoredElements = [...Vue.config.ignoredElements, 'wx-open-launch-weapp']

const app = new Vue({
	store,
	i18n,
	...App
})

// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/request/http.interceptor.js';
Vue.use(httpInterceptor, app);

// http接口API抽离，免于写url或者一些固定的参数
import httpApi from '@/request/http.api.js';
Vue.use(httpApi, app);

app.$mount()